*===============================================================================*
*																				*
*		THIS DO FILE PRODUCES ONLINE APPENDIX TABLE A11 						*
* 		IN LONDONO-VELEZ AND QUERUBIN											*
*		"THE IMPACT OF EMERGENCY CASH ASSISTANCE IN A PANDEMIC: EXPERIMENTAL 	* 
* 		EVIDENCE FROM COLOMBIA", REVIEW OF ECONOMICS AND STATISTICS				*
*																				*
*		LAST MODIFIED: 2021-02-02												*
*																				*
*===============================================================================*

	use 	"${datadir}/main.dta", clear
	
	eststo clear
		foreach o of varlist cov8_3{
		local l`o' : variable label `o'
				if `"`l`o''"' == "" {
					local l`o' "`o'"
					}
		eststo, title("`l`o''"): reghdfe `o' treated $control_lin, abs(codmunicipio $control_fe) vce(robust)
		sum `o' if treated==0
		estadd local ysumm =round(r(mean),.001)	
		estadd local MunFE = "X"
		estadd local Controls = "X"
		eststo, title("`l`o''"): reghdfe `o' treated treated_2_2 $control_lin, abs(codmunicipio $control_fe) vce(robust)
		sum `o' if treated==0
		estadd local ysumm =round(r(mean),.001)	
		estadd local MunFE = "X"
		estadd local Controls = "X"
		estadd local TransferTypeFE = ""
		eststo, title("`l`o''"): reghdfe `o' treated treated_2_2 $control_lin	///
			if (departamento_fea_DPS_data!="BOLIVAR" & departamento_fea_DPS_data!="BOYACA" & ///
			departamento_fea_DPS_data!="CUNDINAMARCA" & departamento_fea_DPS_data!="N SANTANDER" & departamento_fea_DPS_data!="SANTANDER") ///
			, abs(codmunicipio $control_fe transfer2_type) vce(robust)
		sum `o' if treated==0
		estadd local ysumm =round(r(mean),.001)	
		estadd local MunFE = "X"
		estadd local Controls = "X"
		estadd local TransferTypeFE = "X"
		}
		estout using "OnlineAppendix/TA11.xls", replace ///
			cells(b(star fmt(3)) se(par(`"="("'`")""') fmt(3))) dropped(".") keep(treated treated_2_2) label ///
			stats(MunFE Controls TransferTypeFE N r2 ysumm, ///
			labels("Municipality FE" "Baseline controls" "Mode of Transfer FE" "N" "R2" "Control Mean") ///
			fmt(%9.0f %9.0f %9.0f %9.0f %9.3f %9.3f)) starlevels(* 0.1 ** 0.05 *** 0.01) 
		
		
	
